<%@ page import="cn.kgc.day03.entity.Student" %><%--
  Date: 2024/10/10 14:59
  Description:  el表达式的运算
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--
  el表达式的运算
   数学运算
  关系运算
  逻辑运算
  三目运算
--%>

<h3>数学运算</h3>
<h4>1+2 = ${1+2}</h4>
<h4>1*2 = ${1*2}</h4>

<h3>关系运算</h3>
<h4>1>2 = ${1>2}</h4>
<h4>1<2 = ${1<2}</h4>

<h3>逻辑运算</h3>
<h4>true&& false = ${true && false}</h4>

<h3>三目运算</h3>
<h4>${ 1<2 ? "hello":"world"}</h4>

<%
  Student student = new Student();
  student.setName("lisi");
  student.setAge(20);
  student.setId(1);
  request.setAttribute("student",student);
%>

<h3>对象属性值的获取</h3>

<%--
   student.name    getName()    getNme()
--%>
<h4>student.name = ${student.name}</h4>
<h4>student.id = ${student.id}</h4>
<h4>student.age= ${student.age}</h4>


<h3>jstl.jsp number = ${num}</h3>

</body>
</html>
